/* 
 * File:   TestUtils.h
 * Author: enriqueantezana
 *
 * Created on 8 de julio de 2013, 15:57
 */

#ifndef TESTUTILS_H
#define	TESTUTILS_H

class TestUtils
{
public:

    static void populateFileHeader(FileHeader* fHeader, short version, short flag, short compMethod,
                                   short time, short date, int crc, int contentSize, int uncompSize,
                                   short fileNameLength, short extraFieldLength, const char* fileName,
                                   const char* extraField, const char* content)
    {

        fHeader->headerSignature_ = FILE_HEADER_SIGNATURE;
        fHeader->versionNedded_ = version;
        fHeader->flag_ = flag;
        fHeader->compressionMethod_ = compMethod;
        fHeader->lastModifiedTime_ = time;
        fHeader->lastModifiedDate_ = date;
        fHeader->crc_ = crc;
        fHeader->compressedSize_ = contentSize;
        fHeader->unCompressedSize_ = uncompSize;
        fHeader->fileNameLength_ = fileNameLength;
        fHeader->extraFieldLength_ = extraFieldLength;

        fHeader->setFileName(fileName, fHeader->fileNameLength_);
        fHeader->setExtraField(extraField, fHeader->extraFieldLength_);
        fHeader->setContent(content, fHeader->unCompressedSize_);

    }
};
#endif	/* TESTUTILS_H */

